package org.zhangsh.rabbitmq.queue.provider;

import com.rabbitmq.client.Connection;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.zhangsh.rabbitmq.queue.QueueDTO;

/**
 * </p>
 *
 * @author zhangsh
 * @version 1.0.0
 * @since 2019-03-13
 */
@Component
public class Provider {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send(String msg){
        System.out.println("开始发送消息到队列hello-queue >>>>>>>");
        amqpTemplate.convertAndSend("hello-queue", msg);
    }

    public void send(QueueDTO dto){
        System.out.println("开始发送消息到队列hello-queue >>>>>>>");
        amqpTemplate.convertAndSend("hello-queue", dto);
    }

    public void sendWork(){
    }

}
